import request from '@/utils/request'

/**
 *
 * @params{
    "name": "",
  }
 */
// 添加服务项目
export function addItem(data) {
  return request({
    url: '/custom/insert-service-items',
    method: 'post',
    data
  })
}
/**
 *
 */
// 删除服务项目
export function deleteItemById(data) {
  return request({
    url: '/custom/delete-service-items',
    method: 'post',
    data
  })
}

/**
 *
 * @params{
	"id": 0,
	"name": "",
}
 */
// 修改服务项目
export function updateItem(data) {
  return request({
    url: '/custom/update-service-items',
    method: 'post',
    data
  })
}
// 查询服务项目
export function getItemList(data) {
  return request({
    url: '/custom/list-service-items',
    method: 'post',
    data
  })
}
/**
 *
 * @params{
    "name": "",
  }
 */
// 添加客户
export function addCustomer(data) {
  return request({
    url: '/custom/insert',
    method: 'post',
    data
  })
}
/**
 *
 */
// 删除客户
export function deleteCustomerById(data) {
  return request({
    url: '/custom/delete',
    method: 'post',
    data
  })
}

/**
 *
 * @params{
	"id": 0,
	"name": "",
}
 */
// 修改客户
export function updateCustomer(data) {
  return request({
    url: '/custom/update',
    method: 'post',
    data
  })
}
// 查询客户 分页
/**
 *
 * @param {
	"beginTime": "",
	"endTime": "",
	"itemId": 0,
	"mobile": "",
	"name": "",
	"pageNo": 0,
	"pageSize": 0,
	"status": 0,
	"userId": 0
} data
 *
 */
export function getCustomerList(data) {
  return request({
    url: '/custom/page',
    method: 'post',
    data
  })
}

// 查询创建人列表
export function getCustomerCreatorList(data) {
  return request({
    url: '/custom/custom-user-list',
    method: 'post',
    data
  })
}

// 业绩统计
export function getGradeStatistic(data) {
  return request({
    url: '/custom/employee-performance-count',
    method: 'post',
    data
  })
}

// 柱状图
export function getBarData(data) {
  return request({
    url: '/custom/employee-user-receipts',
    method: 'post',
    data
  })
}
// 新增柱状图
export function getNewBarData(data) {
  return request({
    url: '/custom/employee-service-receipts',
    method: 'post',
    data
  })
}

// 折线图
export function getLineData(data) {
  return request({
    url: '/custom/employee-receipts',
    method: 'post',
    data
  })
}
// 修改状态
export function editCustomerStatus(data) {
  return request({
    url: '/custom/update-status',
    method: 'post',
    data
  })
}
// 今日数据
export function getOnedayData(data) {
  return request({
    url: '/custom/home-page-today',
    method: 'post',
    data
  })
}
// 本周数据
export function getWeekData() {
  return request({
    url: '/custom/home-page-week',
    method: 'post'
  })
}
// 本周数据
export function getMonthData() {
  return request({
    url: '/custom/home-page-month',
    method: 'post'
  })
}
// 财务报表
export function getEconomy(data) {
  return request({
    url: '/custom/employee-performance-money',
    method: 'post',
    data
  })
}
